﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace sy2_5
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string input = textBox1.Text.Trim();

            // 使用switch语句判断输入的数字
            switch (input)
            {
                case "1":
                    textBox2.Text = "Monday";
                    break;
                case "2":
                    textBox2.Text = "Tuesday";
                    break;
                case "3":
                    textBox2.Text = "Wednesday";
                    break;
                case "4":
                    textBox2.Text = "Thursday";
                    break;
                case "5":
                    textBox2.Text = "Friday";
                    break;
                case "6":
                    textBox2. Text = "Saturday";
                    break;
                case "7":
                    textBox2.Text = "Sunday";
                    break;
                default:
                    MessageBox.Show("请输入数字1-7!", "输入错误",
                        MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    textBox2.Text = "";
                    textBox1.Focus();
                    textBox1.SelectAll();
                    break;
            }
        }
    }
}